import request from '@/utils/request'


// 获取数据字典数据
export function getDictionaryData(data) {
	return request({
		url: '/xf-api/xf-linggong/jjpoddjob/licensefree/user/getComDictValueByCodes',
		method: 'POST',
		header: {
			appid: "wxd8c9f8c804eeb417tjjjp"
		},
		data,
		options: {
			load: false
		}
	})
}

export function licenseFreelogin(data) { //微信、支付宝小程序授权登录接口
	return request({
		url: "/xf-api/xf-linggong/jjpoddjob/licensefree/xfSysUser/miniAppLogin",
		data,
		method: "POST",
		// type: 'Form'
	});
}
export function getUploadUrl(data) { //获取上传图片url 路径
	return request({
		url: "/xf-api/xf-applet/appletplat/licenseFree/appletUpload",
		data,
		method: "POST",
		options: {
			load: false
		}
	});
}
export function upLoadUrl(data) { //上传文件
	return request({
		url: "/xf-api/xf-applet/appletplat/licenseFree/appletUpload",
		data,
		method: "POST",
	});
}

export function getPhoneAuth(data) { //手机号授权
	return request({
		url: "/xf-api/xf-linggong/jjp/often/XfJjpSysUserLingGong/getByPhone",
		data,
		method: "POST",
	});
}

//登录
export function loginAccount(data) { //账号密码登录
	return request({
		url: "/xf-api/xf-linggong/jjpoddjob/licensefree/xfSysUser/Login",
		data,
		method: "POST",
	});
}

//切换角色
export function changeRole(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobAuthentication/switchStatus`,
		data
	})
}
//获取被评价人信息
export function getCommentBody(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobCompany/obtainQuiltEvaluateInformation`,
		data
	})
}
//获取组织机构树
export function getOrgTree(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/often/XfJjpSysUserLingGong/getOrganizationTree`,
		data
	})
}
//获取监管公司详情
export function getJgCompany(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjpoddjob/licensefree/Info/queryCompanyRegulatoryById`,
		data
	})
}
//获取地图上方统计数据
export function getStaticInfo() {
	return request({
		method: 'GET',
		url: `/xf-api/xf-linggong/jjpoddjob/licensefree/Info/queryCountNum`,
		options: {
			load: false
		}
	})
}
//chatLogin 聊天登录
export function chatLogin(data) {
	return request({
		url: '/xf-api/xf-linggong/login',
		method: 'POST',
		header: {
			appid: "wxd8c9f8c804eeb417tjjjp"
		},
		data,
		options: {
			load: false
		}
	})
}
//获取企业信息
export function getCompanyInfo(data) {
	return request({
		url: '/xf-api/xf-linggong/jjp/xfJjpOddjobCompany/getComInfo',
		method: 'POST',
		data,
		options: {
			load: false
		}
	})
}
//获取用户信息
export function getUserInfo() {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/often/XfJjpSysUserLingGong/queryByIdXfUserIdTwo`
		
	})
}

//职位发布成功后跳转到支付页面，调用接口
export function payJob(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobPayment/payJob`,
		data
	})
}

//职位发布成功后跳转到支付页面，调用接口
export function pay(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobPayment/pay`,
		data
	})
}

//签署合同 支付剩余尾款记录
export function signContract(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobPayment/signContract`,
		data
	})
}

//签署合同-支付接口-去支付
export function signContractPay(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobPayment/signContractPay`,
		data
	})
}

//获取手机号 支付款项值
export function getPhonePayRecord(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobPayment/getPhonePayRecord`,
		data
	})
}

//获取手机号 去支付
export function getPhonePay(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobPayment/getPhonePay`,
		data
	})
}

//用户完工后，企业确认完工 企业申请付钱给用户 算出要付多少钱
export function completeJob(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobPayment/completeJob
`,
		data
	})
}

//用户完工后，企业确认完工 去支付
export function completeJobPay(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobPayment/completeJobPay`,
		data
	})
}

//获取企业logo
export function getLogo(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-applet/appletplat/licenseFree/XfSysAppletSetting/getXfSysAppletSettingById`,
		data
	})
}

//发布职位，验证是否支付过
export function isPayDeposit(data){
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobPayment/isPayDeposit`,
		data
	})
}

// 获取验证码
export function xfSysUserSms(data){
	return request({
		method: 'POST',
		url: `/xf-api/xf-applet/appletplat/licenseFree/xfSysUser/sms?mobile=${data.mobile}`,
		type: 'Form'
	})
}

export function phoneLogin(data){
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjpoddjob/licensefree/xfSysUser/phoneLogin`,
		data,
		type: 'Form'
	})
}

// 注册
export function registeredPassword(data){
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjpoddjob/licensefree/registeredPassword`,
		data:{
			phone: data.phone,
			password: data.password,
			captcha: data.captcha
		},
		header: {
			'X-Access-Token': data.token
		},
	})
}
// 修改密码
export function resetPassword(data){
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjpoddjob/licensefree/resetPassword`,
		data:{
			phone: data.phone,
			password: data.password,
			confirmpassword: data.confirmpassword,
			captcha: data.captcha
		},
		header: {
			'X-Access-Token': data.token
		},
	})

}

//用户端，经济人端，企业端账户注销
export function destroyAccount(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobOften/logoutAccount`,
		data
	})
}
//获取个人系统信息
export function getSysMsg(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobMessage/getPersonalMessages`,
		data
	})
}
//已读
export function sysRead(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobMessage/markSingleRecordAsRead`,
		data
	})
}
//单个删除
export function sysDeleteSingle(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobMessage/markSingleRecordAsDelete`,
		data
	})
}
//批量删除
export function sysDelete(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobMessage/markBatchOrdersAsDelete`,
		data
	})
}
//未读消息个数
export function noRead(data={}) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong//jjp/xfJjpOddjobMessage/fetchUnreadMsgCount`,
		data
	})
}
//系统配置项接口
export function getConfigApprove(data) {
	return request({
		method: 'GET',
		url: `/xf-api/xf-job/job/licenseFree/xfSysBusinessSetting/getSettingValueByCode?code=${data}`
	})
}

//通过职位类型id判断库里的所有职位-取平均薪资
export function validateSalary(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/jjp/xfJjpOddjobInfo/validateSalary`,
		data
	})
}

// 微信绑定详情
export function bindWxDetails(data) {
	return request({
		method: 'POST',
		url: `/xf-api/xf-linggong/often/xfSysUserOpenid/bindWxDetails`,
		data
	})
}

//微信授权获取openid
export function usergetOpenId(data) {
	return request({
		url: "/xf-api/xf-linggong/often/xfSysUserOpenid/wxLoginOfficials",
		data,
		method: "POST",
	});
}


//微信解绑
export function unbindWx(data) {
	return request({
		url: "/xf-api/xf-linggong/often/xfSysUserOpenid/unbindWx",
		data,
		method: "POST",
	});
}
//微信绑定
export function bindWx(data) {
	return request({
		url: "/xf-api/xf-linggong/often/xfSysUserOpenid/bindWx",
		data,
		method: "POST",
	});
}